#include<bits/stdc++.h>

#if 0
//6.1打印二进制序列
void PrintBit(unsigned int n)
{
    for(int i =31;i>=0;i--)
        printf("%d ",1&(n>>i));
    printf("\n");
}
int main()
{
    // printf("%d\n",sizeof(float));
    // printf("%d\n",sizeof(double));
    // printf("%d\n",sizeof(long));
    // unsigned char a = 200;
    // unsigned char b = 100;
    // unsigned char c = 0;
    // c = a + b;
    // PrintBit((int)c);
    // printf("%d %d\n",a+b,c);
    // unsigned int a =  -10;
    // PrintBit(a);
    char p1[15] = "abcd",*p2 = "ABCD",str[50] = "xyz";
    strcpy(str+2,strcat(p1+2,p2+1));
    printf("%s\n",strcat(p1+2,p2+1));
    printf("%s\n",str);
    return 0;
}

#endif






char* my_strcpy(char* dest,const char* src)
{
  assert(dest && src);
  char* ret = dest;
  while(*dest++ = *src++) ;
  
  return ret;
}

int my_strcmp(const char* s1,const char* s2)
{
  assert(s1 && s2);
  while(*s1 && *s2 &&(*s1++ == *s2++)) ;
  return *s1 - *s2;  
}

int main()
{
 char buf[50] = {0};
 const char* str = "hello Mango";
 printf("%s\n",my_strcpy(buf,str));

 char s1[50],s2[50];
 scanf("%s %s",s1,s2);
 printf("%d\n",my_strcmp(s1,s2));
 printf("%d\n",strcmp(s1,s2));
 return 0;
}






